package com.luoxue.controller;

import com.luoxue.service.UserService;
import com.luoxue.util.ResultBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/login")
    public ResultBody login(String username, String password) throws Exception {
        return userService.login(username, password);
    }

    @GetMapping("/logout")
    public ResultBody logout() {
        return userService.logout();
    }

    @GetMapping("/getUser")
    public ResultBody getUser() {
        return userService.getUser();
    }

}
